﻿using System.Collections.Generic;

namespace WeWork.Model
{
    /// <summary>
    /// 会话记录消息
    /// </summary>
    public class ChatRecord : MsgChatRoomBase
    {
        /*
        {
            "msgid":"11354299838102555191_1603875658",
            "action":"send",
            "from":"ken",
            "tolist":["icef"],
            "roomid":"",
            "msgtime":1603875657905,
            "msgtype":"chatrecord",
            "chatrecord":{
                "title":"群聊",
                "item":[
                    {"type":"ChatRecordText","msgtime":1603875610,"content":"{\"content\":\"test\"}","from_chatroom":false},
                    {"type":"ChatRecordText","msgtime":1603875620,"content":"{\"content\":\"test2\"}","from_chatroom":false}
                ]
            }
        }
        */
        /// <summary>
        /// 消息内容
        /// </summary>
        public RecordInfo chatrecord { set; get; }
    }

    public class RecordInfo
    {
        /// <summary>
        /// 聊天记录标题。String类型
        /// </summary>
        public string title { set; get; }
        /// <summary>
        /// 消息记录内的消息内容，批量数据
        /// </summary>
        public List<RecordItem> item { set; get; }
    }
    public class RecordItem
    {
        /// <summary>
        /// 每条聊天记录的具体消息类型：ChatRecordText/ ChatRecordFile/ ChatRecordImage/ ChatRecordVideo/ ChatRecordLink/ ChatRecordLocation/ ChatRecordMixed ….
        /// </summary>
        public string type { set; get; }
        /// <summary>
        /// 消息时间，utc时间，单位秒。
        /// </summary>
        public long msgtime { set; get; }
        /// <summary>
        /// 消息内容。Json串，内容为对应类型的json。String类型
        /// </summary>
        public string content { set; get; }
        /// <summary>
        /// 是否来自群会话。Bool类型
        /// </summary>
        public bool from_chatroom { set; get; }
    }
}
